Custom Node DLL

The Custom Node DLL integrates any user-provided DLL file, written in C language. It usually implements the functionality of a SUT and should be placed before the Parameter Exchange Node.

The interface for any node is defined by four functions. Add these to your source code:

If more than one Custom Node DLL is used, the order of the nodes matters if they share signals. For creating a Custom Node DLL, see Create a Custom Node from a MATLAB Simulink model.

Custom Node DLL with version information and startup arguments

It is possible to reload the DLL by executing the Reset target step, see Service Step Type - INCA. This step will call again the functions tpt_fusion_node_startup and tpt_fusion_node_initfcn.
For detailed information about the functions and how to program a Custom Node DLL, see FUSION Programmers Guide - Introduction to Building FUSION Nodes.

Node DLL

Select a DLL.

Use arguments

Select this checkbox to enable the Node arguments text field.

Node arguments

The node arguments added here serve as values of the argument argv from the function tpt_fusion_node_startup(tpt_fusion_node_handle handle, int argc, char **argv). argv is a list; its length depends on the amount of node argument values you add.

Only string values are allowed. The first argument value is added as string value to argv[0], the second to argv[1], and so forth. By using conditions in the source code in conjunction with the argv values, you can easily change the code behavior without having to compile the code over and over again.

Enter the appropriate node arguments. Several argument values must be separated by a space. Argument names that contain spaces must be placed in quotation marks, for example "exec 234". Environment variables can be used, see Environment Variables.

64 bit DLL

If you have a 64Bit DLL, select this checkbox to specify that it should be run with 64bit to avoid a runtime error at execution time.

Rename mapping

A Custom Node DLL can have its own mapping or it uses the mapping from the FUSION Platform. If a mapping for a Custom Node DLL contains a Rename mapping flavor, the Custom Node DLL will use the external name while the FUSION Platformautomatically handles the given information under the signal name as specified in the Declaration Editor. This is relevant when using operations like getVariableName().

Thus, if variable names in the custom DLL differ from the variable names in TPT, you can choose a mapping to specify the name correlation. Use the External Name from the Rename mapping flavor, see Mapping Flavor - Rename, to specify the DLL variable name for each TPT channel/parameter. You can select no mapping at all, use a mapping from the platform, or a mapping from the Declaration Editor.

If in older files (TPT 12), the Use External Name from Rename flavor checkbox was selected, and you open this file in a new TPT (since TPT 13), TPT automatically selects <Use mapping from platform> and selects the Use Hidden flag from Rename Flavor checkbox.

Version info

The Custom Node DLL can automatically read the version information of the given DLL file. Click on Read version information. Version information is only provided, when the DLL file contains the following parameters: versioninfo_get_package(), versioninfo_get_version(), and versioninfo_get_checksum().

Interface import

Furthermore the interface of the node can be imported. Note that signals are not recognized as input or output channels and that the data type may be changed as the FUSION Platform handles each signal as int64 or double. Imported functions will be handled as client functions and all arguments will be handled as IN arguments. Structured signals will be imported in the same order they are implemented in the Custom Node DLL.